#ifndef COMPUTETRIMESHVISITOR_H
#define COMPUTETRIMESHVISITOR_H

#include <osg/Node>
#include <osg/Geometry>
#include <osg/MatrixTransform>
#include <osg/NodeVisitor>
#include <osg/Geode>

class ComputeTriMeshVisitor : public osg::NodeVisitor
{
public:
    ComputeTriMeshVisitor( osg::NodeVisitor::TraversalMode traversalMode = TRAVERSE_ALL_CHILDREN );
    virtual void reset();
    osg::Vec3Array* getTriMesh()
    {
        return( mesh.get() );
    }
    void apply( osg::Geode & geode );
protected:
    void applyDrawable( osg::Drawable * drawable );
    osg::ref_ptr< osg::Vec3Array > mesh;

};

#endif // COMPUTETRIMESHVISITOR_H
